home *** CD-ROM | disk | FTP | other *** search
- Path: netnews.fast.net!news
- From: 73541.1332@compuserve.com
- Newsgroups: comp.lang.c++
- Subject: Re: Dynamic Casting / RTTI
- Date: 23 Mar 1996 17:00:20 GMT
- Organization: via FASTNET(tm) PA/NJ/DE Internet Services
- Message-ID: <4j1an4$qpv@nn2.fast.net>
- References: <DoJF68.Mx8@news.uwindsor.ca>
- Reply-To: 73541.1332@compuserve.com
- NNTP-Posting-Host: power.gpu.com
- X-Newsreader: IBM NewsReader/2 v1.2
-
- RTTI specifies that you MUST have at least onne virtual function in base to dynamic cast
- Your example has none.
-
-
- In <DoJF68.Mx8@news.uwindsor.ca>, saed@engn.uwindsor.ca (Saed Aryan,13325,1100,g) writes:
- >
- >Hi All,
- >
- >given the following code:
- >
- >class Base{};
- >class Deri : public Base{};
- >main(){ Base * pB = new Deri; };
- >
- >--- How do can I obtain a 'Deri' class pointer to the same object as pB?
- >
- >sort of like: Deri * pD = dynamic_cast<Deri*>(pB);
- >but this yields an error:
- >cannot dynamic_cast `pB' (of type `class Base *') to type `class Deri *'
- >
- >Lots of thanks in advance,
- >
- >Aryan saed@engn.uwindsor.ca
- >
- >
- >
-
-